package com.myexam.action;

import java.util.Map;

import org.apache.struts2.interceptor.RequestAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.myexam.model.Exam;
import com.myexam.service.TeacherService;
import com.opensymphony.xwork2.ActionSupport;
@Controller
@Scope("prototype")
public class ExamUpdateShowAction extends ActionSupport implements RequestAware {

	private static final long serialVersionUID = -1373788006250153356L;
	private Map<String, Object> request;
	private int exam_id;
	@Autowired
	private TeacherService teacherService;
	public int getExam_id() {
		return exam_id;
	}
	public void setExam_id(int exam_id) {
		this.exam_id = exam_id;
	}
	
	public Map<String, Object> getRequest() {
		return request;
	}
	public void setRequest(Map<String, Object> request) {
		this.request = request;
	}
	public String execute()throws Exception{
		Exam exam = teacherService.examUpdateShow(exam_id);
		request.put("exam", exam);
		return SUCCESS;
	}
}
